package com.infore.siteManagement.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.infore.siteManagement.entity.AreaLevel;
import com.infore.siteManagement.select.dto.QueryParamDto;
import com.infore.siteManagement.service.IAreaLevelService;
import com.infore.siteManagement.util.ResultEntity;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@Api(value = "区域等级管理接口", tags = {"区域等级管理接口" })
@RestController
@RequestMapping("/areaLevel")
public class AreaLevelController {

	@Autowired
	private IAreaLevelService iAreaLevelService;
	
	@ApiOperation(value = "查询区域等级通用接口")
	@ResponseBody
	@PostMapping(value = "/query")
	public ResultEntity queryAreaLevel(@RequestBody(required = false) QueryParamDto queryParamDto) {
		return iAreaLevelService.queryAreaLevel(queryParamDto);
	}
	
	@ApiOperation(value = "删除区域等级通用接口")
	@ApiImplicitParams(@ApiImplicitParam(value = "区域等级id", name = "ids", paramType = "query",required = true,dataType = "String"))
	@DeleteMapping(value = "/delete")
	public ResultEntity deleteAreaLevel(String ids) {
		return iAreaLevelService.deleteAreaLevel(ids);
	}
	
	@ApiOperation(value = "编辑/新增区域等级通用接口")
	@ResponseBody
	@PostMapping(value = "/edit")
	public ResultEntity editAreaLevel(@RequestBody AreaLevel areaLevel) {
		return iAreaLevelService.editAreaLevel(areaLevel);
	}
	
	@ApiOperation(value = "验证区域等级通用接口")
	@ResponseBody
	@PostMapping(value = "/validate")
	public ResultEntity validateAreaLevel(@RequestBody AreaLevel areaLevel) {
		return iAreaLevelService.validateAreaLevel(areaLevel);
	}
	
}
